////<!--盘点流水-->
import api from '../../../fetch/api'

export default {
  data() {
    return {
      bigImgPath: ''
    }
  },
  created() {
    // this.getItemList();
  },
  methods: {
    getList() {
      let params = $.extend({}, this.searchParams, this.otherParams);
      this.getItemList(params);
    },
    showBigImgModal(name, path) {
      this.bigImgPath = path;
      this.toOpenImgModal(name, path);
    },
    //获取列表
    getItemList(aparams) {
      let self = this,
        params = {
          page: this.pageNumber,
          pageSize: this.pageSize
        };
      params = $.extend({}, params, aparams);
      // API.coupon.GetTraderListData(params)
      api.fetchGet('mobile/parkingCheck/list.do', params)
        .then(res => {
          // console.log('getListResult', res)
          let data = res.data;
          self.tbodysInfo = data.rows;
          self.total = data.total;
        }, err => {})
    },
    exportData() {
      let self = this;
      let theadsArr = []
      for(let i = 0; i<self.theadsInfo.length; i++){
        if(self.theadsInfo[i].checked){
          theadsArr.push(self.theadsInfo[i].prop)
        }
      }
      let params = {
        meterList: theadsArr.join(',')
      };
      params = $.extend({}, params, this.searchParams, this.otherParams);
      self.showDialog("确认导出该报表?", '', function () {
        self.toExportAsync('mobile/parkingCheck/export.do', params)
      })
    },
    showParkingCheckDetail(modalName, code, checkStatus, isMarkNight) { //打开详情
      let self = this;
      var searchList = [{
        name: "code",
        value: code
      },{
        name: "query_time_pandian",
        value: ""
      }];
      if (typeof(checkStatus) != "undefined") {
        searchList.push({
          name: "checkStatus",
          value: checkStatus
        });
      }
      if (typeof(isMarkNight) != "undefined") {
        searchList.push({
          name: "isMarkNight",
          value: isMarkNight
        });
      }
      self.detailSetData.searchList = searchList;

      this.toOpenModal("parkingCheckDetailModal");
    }
  }
}
